﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using System.ApplicationModel;

namespace System.ApplicationModel.Composition
{
    /// <summary>
    /// Export contract for a ViewModel.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class,AllowMultiple = false, Inherited = false)]
    public sealed class ViewModelExportAttribute : ExportAttribute
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="System.ApplicationModel.Composition.ViewModelExportAttribute"/> class.
        /// </summary>
        /// <param name="contractName">The name of the ViewModel.</param>
        public ViewModelExportAttribute(string contractName) : this(contractName, typeof(object)) { }

        /// <summary>
        /// Initializes a new instance of the <see cref="System.ApplicationModel.Composition.ViewModelExportAttribute"/> class.
        /// </summary>
        /// <param name="contractName">The name of the ViewModel.</param>
        /// <param name="contractType">The type of the ViewModel.</param>
        public ViewModelExportAttribute(string contractName, Type contractType)
            : base(contractName + "ViewModel", contractType)
        {
        }
    }
}
